#!/bin/bash
container_id=`docker ps -q`
if [ -n "$container_id" ]; then
    docker stop $container_id
    docker rm $container_id
else
    echo "NOT Running Container!"
fi

# delete images
images_id=`docker images -q|head -n -2`
if [ -n "$images_id" ]; then
    docker rmi -f $images_id
else
    echo "do nothing"
fi
#docker rmi -f `docker images -q|head -n -2`

